package com.wanmait.bootdemo.service.impl;



import com.wanmait.bootdemo.mapper.CartypeMapper;
import com.wanmait.bootdemo.pojo.Cartype;
import com.wanmait.bootdemo.service.CarTypeService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class CarTypeServiceimpl implements CarTypeService {
    private static final Logger logger = LogManager.getLogger(CarTypeServiceimpl.class);

    @Resource
    private CartypeMapper cartypeMapper;

    @Override
    public void updateSort(Integer id, Integer sort) {
        System.out.println("sdfghjk");
    }

    @Override
    public void increaseQuestionCount(Integer id) {

    }

    @Override
    public void decreaseQuestionCount(Integer id) {

    }


    @Override
    public List<Cartype> findAll() {
        logger.debug("debug.....................");
        logger.info("info");
        logger.warn("warn");

        return cartypeMapper.selectList();

    }

    @Override
    public Cartype findById(Integer id) {
        return cartypeMapper.findById(id);
    }

//    @Override
//    public List<Cartype> findAll(Pager pager) {
//        logger.info("info............");
//      return cartypeMapper.selectList();
//    }

    @Override
    public int getDataCount() {
        return 0;
    }

    @Override
    public void insert(Cartype object) {

    }

    @Override
    public void update(Cartype object) {

    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

//    @Override
//    public PageInfo<Cartype> findPage(int pageNum, int pageSize) {
//        PageHelper.startPage(pageNum, pageSize);
//        List<Cartype> cartypes = cartypeMapper.selectList();
//        PageInfo<Cartype> pageInfo = new PageInfo<>(cartypes);
//        return pageInfo;
//
//    }


}
